/****** Object:  Stored Procedure [dbo].spChiTietPhieuXuatSelectAllBySoPX Script Date: 6/23/2012 ******/
IF EXISTS (SELECT * FROM dbo.sysobjects WHERE id = object_id(N'[dbo].[spChiTietPhieuXuatSelectAllBySoPX]') AND OBJECTPROPERTY(id, N'IsProcedure') = 1)
	DROP PROCEDURE [dbo].[spChiTietPhieuXuatSelectAllBySoPX]
GO

/******************************************************************************
**		Change History
*******************************************************************************
**		Date:		Author:					Description:
**		--------	--------				-----------------------------------
**		23/06/2012	SongTM					Innit created
*******************************************************************************/

CREATE PROCEDURE [dbo].[spChiTietPhieuXuatSelectAllBySoPX]
(
	@SoPX nvarchar(14)
)
WITH ENCRYPTION

AS

SET NOCOUNT ON

SELECT 
	CTX.*,
	CTN.MaThuoc,
	CTN.SoLo
FROM [tbl_ChiTietPhieuXuat] as CTX INNER JOIN [tbl_LuuKho] as CTN ON CTX.MaLuuKho = CTN.MaLuuKho
WHERE [SoPX] = @SoPX
GO

--GRANT EXECUTE ON [dbo].[spChiTietPhieuXuatSelectAllBySoPX] TO [sa]
--GO
